/**
 * Created by IntelliJ IDEA.
 * User: scotthatcher
 * Date: Mar 24, 2010
 * Time: 1:04:38 PM
 * To change this template use File | Settings | File Templates.
 */
import java.util.*;
import acm.program.*;


public class Tokenizer extends ConsoleProgram{


    public void run(){
        setFont("Times New Roman-26");
        String line = readLine("Enter line to tokenize: ");
        println("The tokens of the string are:");
        printTokens(line);
}
    private void printTokens(String str){
        StringTokenizer tokenizer = new StringTokenizer(str, ", ");  //anything added in the quotes will act like a deliminator
        for(int count = 0; tokenizer.hasMoreTokens(); count++){
            println("Tokens #" + count + ": " + tokenizer.nextToken());
        }
            

    }
}